﻿/******************************************************************************
 *  All Rights Reserved , Copyright (C) 2012 , EricHu. 
 *  作    者： EricHu
 *  创建时间： 2012-7-20 16:35:50
 ******************************************************************************/
//--------------------------------------------------------------------
// All Rights Reserved , Copyright (C) 2012 , gt TECH, Ltd.
//--------------------------------------------------------------------

using System;
using System.Data;

namespace RDIFramework.BusinessEntity
{
  using RDIFramework.Utilities;

 /// <summary>
 /// PiOrganizeEntity
 /// 组织机构、部门表
 ///
 /// 修改纪录
 ///
 ///		2012-03-02 版本：1.0 EricHu 创建主键。
 ///
 /// 版本：1.0
 ///
 /// <author>
 ///		<name>EricHu</name>
 ///		<date>2012-03-02</date>
 /// </author>
 /// </summary>
 [Serializable]
 public partial class PiOrganizeEntity
 {
  private int? id = null;
  /// <summary>
  /// 主键
  /// </summary>
  public int? Id
  {
      get
      {
          return this.id;
      }
      set
      {
          this.id = value;
      }
  }

  private int? parentId = null;
  /// <summary>
  /// 父级主键
  /// </summary>
  public int? ParentId
  {
      get
      {
          return this.parentId;
      }
      set
      {
          this.parentId = value;
      }
  }

  private String code = string.Empty;
  /// <summary>
  /// 编号
  /// </summary>
  public String Code
  {
      get
      {
          return this.code;
      }
      set
      {
          this.code = value;
      }
  }

  private String shortName = string.Empty;
  /// <summary>
  /// 简称
  /// </summary>
  public String ShortName
  {
      get
      {
          return this.shortName;
      }
      set
      {
          this.shortName = value;
      }
  }

  private String fullName = string.Empty;
  /// <summary>
  /// 名称
  /// </summary>
  public String FullName
  {
      get
      {
          return this.fullName;
      }
      set
      {
          this.fullName = value;
      }
  }

  private String category = string.Empty;
  /// <summary>
  /// 分类
  /// </summary>
  public String Category
  {
      get
      {
          return this.category;
      }
      set
      {
          this.category = value;
      }
  }

  private String outerPhone = string.Empty;
  /// <summary>
  /// 外线电话
  /// </summary>
  public String OuterPhone
  {
      get
      {
          return this.outerPhone;
      }
      set
      {
          this.outerPhone = value;
      }
  }

  private String innerPhone = string.Empty;
  /// <summary>
  /// 内线电话
  /// </summary>
  public String InnerPhone
  {
      get
      {
          return this.innerPhone;
      }
      set
      {
          this.innerPhone = value;
      }
  }

  private String fax = string.Empty;
  /// <summary>
  /// 传真
  /// </summary>
  public String Fax
  {
      get
      {
          return this.fax;
      }
      set
      {
          this.fax = value;
      }
  }

  private String postalcode = string.Empty;
  /// <summary>
  /// 邮编
  /// </summary>
  public String Postalcode
  {
      get
      {
          return this.postalcode;
      }
      set
      {
          this.postalcode = value;
      }
  }

  private String address = string.Empty;
  /// <summary>
  /// 地址
  /// </summary>
  public String Address
  {
      get
      {
          return this.address;
      }
      set
      {
          this.address = value;
      }
  }

  private String web = string.Empty;
  /// <summary>
  /// 网址
  /// </summary>
  public String Web
  {
      get
      {
          return this.web;
      }
      set
      {
          this.web = value;
      }
  }

  private String manager = string.Empty;
  /// <summary>
  /// 主负责人
  /// </summary>
  public String Manager
  {
      get
      {
          return this.manager;
      }
      set
      {
          this.manager = value;
      }
  }

  private int? layer = 0;
  /// <summary>
  /// 层
  /// </summary>
  public int? Layer
  {
      get
      {
          return this.layer;
      }
      set
      {
          this.layer = value;
      }
  }

  private String assistantManager = string.Empty;
  /// <summary>
  /// 副负责人
  /// </summary>
  public String AssistantManager
  {
      get
      {
          return this.assistantManager;
      }
      set
      {
          this.assistantManager = value;
      }
  }

  private int? isInnerOrganize = 1;
  /// <summary>
  /// 内部组织机构
  /// </summary>
  public int? IsInnerOrganize
  {
      get
      {
          return this.isInnerOrganize;
      }
      set
      {
          this.isInnerOrganize = value;
      }
  }

  private String bank = string.Empty;
  /// <summary>
  /// 开户行
  /// </summary>
  public String Bank
  {
      get
      {
          return this.bank;
      }
      set
      {
          this.bank = value;
      }
  }

  private String bankAccount = string.Empty;
  /// <summary>
  /// 银行帐号
  /// </summary>
  public String BankAccount
  {
      get
      {
          return this.bankAccount;
      }
      set
      {
          this.bankAccount = value;
      }
  }

  private int? deleteMark = 0;
  /// <summary>
  /// 删除标记
  /// </summary>
  public int? DeleteMark
  {
      get
      {
          return this.deleteMark;
      }
      set
      {
          this.deleteMark = value;
      }
  }

  private int? enabled = 1;
  /// <summary>
  /// 有效
  /// </summary>
  public int? Enabled
  {
      get
      {
          return this.enabled;
      }
      set
      {
          this.enabled = value;
      }
  }

  private int? sortCode = null;
  /// <summary>
  /// 排序码
  /// </summary>
  public int? SortCode
  {
      get
      {
          return this.sortCode;
      }
      set
      {
          this.sortCode = value;
      }
  }

  private String description = string.Empty;
  /// <summary>
  /// 描述
  /// </summary>
  public String Description
  {
      get
      {
          return this.description;
      }
      set
      {
          this.description = value;
      }
  }

  private DateTime? createOn = DateTime.Now;
  /// <summary>
  /// 创建日期
  /// </summary>
  public DateTime? CreateOn
  {
      get
      {
          return this.createOn;
      }
      set
      {
          this.createOn = value;
      }
  }

  private String createUserId = string.Empty;
  /// <summary>
  /// 创建用户主键
  /// </summary>
  public String CreateUserId
  {
      get
      {
          return this.createUserId;
      }
      set
      {
          this.createUserId = value;
      }
  }

  private String createBy = string.Empty;
  /// <summary>
  /// 创建用户
  /// </summary>
  public String CreateBy
  {
      get
      {
          return this.createBy;
      }
      set
      {
          this.createBy = value;
      }
  }

  private DateTime? modifiedOn = null;
  /// <summary>
  /// 修改日期
  /// </summary>
  public DateTime? ModifiedOn
  {
      get
      {
          return this.modifiedOn;
      }
      set
      {
          this.modifiedOn = value;
      }
  }

  private String modifyUserId = string.Empty;
  /// <summary>
  /// 修改用户主键
  /// </summary>
  public String ModifyUserId
  {
      get
      {
          return this.modifyUserId;
      }
      set
      {
          this.modifyUserId = value;
      }
  }

  private String modifiedBy = string.Empty;
  /// <summary>
  /// 修改用户
  /// </summary>
  public String ModifiedBy
  {
      get
      {
          return this.modifiedBy;
      }
      set
      {
          this.modifiedBy = value;
      }
  }

  /// <summary>
  /// 构造函数
  /// </summary>
  public PiOrganizeEntity()
  {
  }

  /// <summary>
  /// 构造函数
  /// </summary>
  /// <param name="dataRow">数据行</param>
  public PiOrganizeEntity(DataRow dataRow)
  {
      this.GetFrom(dataRow);
  }

  /// <summary>
  /// 构造函数
  /// </summary>
  /// <param name="dataReader">数据流</param>
  public PiOrganizeEntity(IDataReader dataReader)
  {
      this.GetFrom(dataReader);
  }

  /// <summary>
  /// 构造函数
  /// </summary>
  /// <param name="dataTable">数据表</param>
  public PiOrganizeEntity(DataTable dataTable)
  {
      this.GetFrom(dataTable);
  }

  /// <summary>
  /// 从数据表读取
  /// </summary>
  /// <param name="dataTable">数据表</param>
  public PiOrganizeEntity GetFrom(DataTable dataTable)
  {
      if ((dataTable == null) || (dataTable.Rows.Count == 0))
      {
          return null;
      }
      foreach (DataRow dataRow in dataTable.Rows)
      {
          this.GetFrom(dataRow);
          break;
      }
      return this;
  }

  /// <summary>
  /// 从数据行读取
  /// </summary>
  /// <param name="dataRow">数据行</param>
  public PiOrganizeEntity GetFrom(DataRow dataRow)
  {
      this.Id = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldId]);
      this.ParentId = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldParentId]);
      this.Code = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldCode]);
      this.ShortName = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldShortName]);
      this.FullName = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldFullName]);
      this.Category = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldCategory]);
      this.OuterPhone = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldOuterPhone]);
      this.InnerPhone = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldInnerPhone]);
      this.Fax = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldFax]);
      this.Postalcode = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldPostalcode]);
      this.Address = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldAddress]);
      this.Web = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldWeb]);
      this.Manager = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldManager]);
      this.Layer = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldLayer]);
      this.AssistantManager = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldAssistantManager]);
      this.IsInnerOrganize = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldIsInnerOrganize]);
      this.Bank = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldBank]);
      this.BankAccount = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldBankAccount]);
      this.DeleteMark = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldDeleteMark]);
      this.Enabled = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldEnabled]);
      this.SortCode = BusinessLogic.ConvertToInt(dataRow[PiOrganizeTable.FieldSortCode]);
      this.Description = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldDescription]);
      this.CreateOn = BusinessLogic.ConvertToDateTime(dataRow[PiOrganizeTable.FieldCreateOn]);
      this.CreateUserId = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldCreateUserId]);
      this.CreateBy = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldCreateBy]);
      this.ModifiedOn = BusinessLogic.ConvertToDateTime(dataRow[PiOrganizeTable.FieldModifiedOn]);
      this.ModifyUserId = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldModifyUserId]);
      this.ModifiedBy = BusinessLogic.ConvertToString(dataRow[PiOrganizeTable.FieldModifiedBy]);
      return this;
  }

  /// <summary>
  /// 从数据流读取
  /// </summary>
  /// <param name="dataReader">数据流</param>
  public PiOrganizeEntity GetFrom(IDataReader dataReader)
  {
      this.Id = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldId]);
      this.ParentId = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldParentId]);
      this.Code = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldCode]);
      this.ShortName = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldShortName]);
      this.FullName = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldFullName]);
      this.Category = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldCategory]);
      this.OuterPhone = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldOuterPhone]);
      this.InnerPhone = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldInnerPhone]);
      this.Fax = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldFax]);
      this.Postalcode = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldPostalcode]);
      this.Address = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldAddress]);
      this.Web = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldWeb]);
      this.Manager = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldManager]);
      this.Layer = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldLayer]);
      this.AssistantManager = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldAssistantManager]);
      this.IsInnerOrganize = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldIsInnerOrganize]);
      this.Bank = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldBank]);
      this.BankAccount = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldBankAccount]);
      this.DeleteMark = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldDeleteMark]);
      this.Enabled = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldEnabled]);
      this.SortCode = BusinessLogic.ConvertToInt(dataReader[PiOrganizeTable.FieldSortCode]);
      this.Description = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldDescription]);
      this.CreateOn = BusinessLogic.ConvertToDateTime(dataReader[PiOrganizeTable.FieldCreateOn]);
      this.CreateUserId = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldCreateUserId]);
      this.CreateBy = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldCreateBy]);
      this.ModifiedOn = BusinessLogic.ConvertToDateTime(dataReader[PiOrganizeTable.FieldModifiedOn]);
      this.ModifyUserId = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldModifyUserId]);
      this.ModifiedBy = BusinessLogic.ConvertToString(dataReader[PiOrganizeTable.FieldModifiedBy]);
      return this;
  }
  }
}
